page.form = {};
page.form.init=function(){
	$("#selectBtn").bind("click",function(){
		page.form.event.select();
	});
};
page.form.event = {
	submit:function(dialog,callback,index){
		$('#mainForm').validate();
		var validate = $('#mainForm').valid();
		if (validate) {
			var data = $('#mainForm').serialize() // 要提交的表单,必须使用name属性
			  $.dataPost(contextPath+"/system/tenant/tenantUpdate.htm",data,function(result){
				  if(result.success){
					 if(callback)callback();
					 dialog.close(index);
				  }else{
					 layer.msg(result.msg);
				  }
			  });
		}
   },select :function(){
		openIframeWindow("选择母公司",contextPath+"/system/tenant/selectView.htm",{},function(node){
			 $("#parentOrgName").val(node.orgName);
			 $("#parentOrgId").val(node.orgId);
		  });
	}		
}


